﻿@using SimplCommerce.Module.Core.Models
@using SimplCommerce.Module.Core.Extensions

@inject IWorkContext WorkContext
@inject SignInManager<User> SignInManager

@if (SignInManager.IsSignedIn(User))
{
    <a class="flex-c-m trans-04 p-lr-25" asp-area="Core" asp-controller="Manage" asp-action="Index" title="@Localizer["Manage"]">@Localizer["Hello {0}!", (await WorkContext.GetCurrentUser()).FullName]</a>
    if (User.IsInRole("admin") || User.IsInRole("vendor"))
    {
       <a class="flex-c-m trans-04 p-lr-25" asp-area="Core" asp-controller="HomeAdmin" asp-action="Index">@Localizer["Dashboard"]</a>
    }
    <form asp-area="Core" asp-controller="Account" asp-action="LogOff" method="post" id="logoutForm" class="">
        <button type="submit" class="logoff flex-c-m trans-04 p-lr-25">@Localizer["Log off"]</button>
    </form>
}
else
{
    <a class="flex-c-m trans-04 p-lr-25" asp-area="Core" asp-controller="Account" asp-action="Login">@Localizer["Log in"]</a>
    <a class="flex-c-m trans-04 p-lr-25" asp-area="Core" asp-controller="Account" asp-action="Register">@Localizer["Register"]</a>
}
